package com.auemall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.auemall.dao.BuyerMapper;
import com.auemall.po.Buyer;
import com.auemall.service.BuyerService;

@Service
public class BuyerServiceImpl implements BuyerService {

	@Autowired
	private BuyerMapper buyerMapper;
	
	
	public int deleteByPrimaryKey(Integer id) {
		
		return buyerMapper.deleteByPrimaryKey(id);
	}

	
	public int insert(Buyer record) {
		
		return buyerMapper.insert(record);
	}

	
	public int insertSelective(Buyer record) {
		
		return buyerMapper.insertSelective(record);
	}

	
	public Buyer selectByPrimaryKey(Integer id) {
		
		return buyerMapper.selectByPrimaryKey(id);
	}

	
	public int updateByPrimaryKeySelective(Buyer record) {
		
		return buyerMapper.updateByPrimaryKeySelective(record);
	}

	
	public int updateByPrimaryKey(Buyer record) {
	
		return buyerMapper.updateByPrimaryKeySelective(record);
	}


	
	public Buyer findBuyerByCondition(Buyer record) {

		List<Buyer> list = this.buyerMapper.findBuyerByCondition(record);
		
		if (list != null && list.size() >0 ) {
			
			return list.get(0);
		}
		
		return null;
	}

}
